<?php

class Ragtek_Helper_Permissions{

    /**
     * @static
     * @param XenForo_Model_Node $nodeModel
     * @return string
     */
    public static function getForumListString(XenForo_Model_Node $nodeModel = NULL)
    {
       $nodeIDs = self::getForumListArray($nodeModel);
       $nodesString = implode($nodeIDs, ', ');
       return $nodesString;
    }

    /**
     * @static
     * @param XenForo_Model_Node $nodeModel
     * @return array
     */
    public static function getForumListArray(XenForo_Model_Node $nodeModel = NULL)
    {
        if ($nodeModel == NULL){
            $nodeModel = XenForo_Model::create('XenForo_Model_Node');
        }
        $nodes = $nodeModel->getViewableNodeList();
        return array_keys($nodes);
    }
}